

#include "tcp_ruitu.h"
#include <iostream>
#include <thread>
#include <iostream>
#include <string>
using namespace std;




client_for_result * client = new client_for_result("/home/g/tcp_ruitu/ruitu_sdk_for_cmake/try_libing/",30 , "robot003");

void judge()
{
    while(1)
    {
        cout<<client-> judgment()<<endl;
        std::this_thread::sleep_for(std::chrono::milliseconds(300));
    }
}

void looper()
{
   client->loop();
}

void feed()
{
    while(1)
    {   
        char str1[200];
        cin>>str1;
        string str = str1;
        client->feed_in(str);
        //client->outloop();
    }
}

int main(int argc, char** argv)
{
    thread mythread1(feed);
    mythread1.detach();
    //thread mythread2(judge);
    //mythread2.detach();
    client->loop();
    std::cout<<"出来了出来了"<<std::endl;
    delete client;
    client = NULL;
    return 0;
}


